The Accordion Pane Component >Events > onSelect()

 

FAccordionPane : Event : onSelect()

Availability

Flash Player 6.

Usage

myAccordionListener.onSelect = function( acp, item ) { ... }

Parameters

acp A reference to the AccordionPane component which triggered the event.
item An Object which contains the data associated with the event which was triggered.

Returns


Nothing

Description

This event is triggered by the AccordionPane whenever a new item is selected by the user or with the setSelectedItem method. Once it is triggered, it is broadcast to all listeners. Listeners may subscribe to listen for the onSelect event with the addListener method.

 

Example

The accordion_addListener.fla example file contains an example of using this method.

The following example traces a message to the output window each time the user selects a new item.

// make an object to listen for the onSelect event
listener = new Object();


// subscribe the object to listen for onSelect
myAccordion_acp.addListener(listener);


// define a handler to be triggered when the user selects a new item.
listener.onSelect = function (acp, item)
{
	trace ("item with label '" + item.label + "' was selected");
}

See also

FAccordionPane.addListener()

FAccordionPane.removeListener()